package cn.spark.study.core
/*
 * 自定义排序Key
 * 继承 Ordered[T] 和 Serializable 方法
 * 实现 compare 方法
 */
class SecondSortKey(val first: Int,val secode:Int) extends Ordered[SecondSortKey] with Serializable{
  def compare(that:SecondSortKey): Int = {
    if(this.first - that.first !=0){
      this.first - that.first
    }else{
      this.secode - that.secode
    }
  }
}